package com.wteam.dragon.shop.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户地址
 * @Author 陈晓辉
 * @Date 2021/4/8 9:21
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class Address extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "收货人名字")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String receiveName;

    @IsNotNull
    @Column(comment = "收货人电话")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String receivePhone;

    @IsNotNull
    @Column(comment = "是否为默认地址")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Boolean isDefault;

    @Column(comment = "邮政编码")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String postCode;

    @IsNotNull
    @Column(comment = "省份/直辖市")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String province;

    @IsNotNull
    @Column(comment = "城市")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String city;

    @IsNotNull
    @Column(comment = "区")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String region;

    @IsNotNull
    @Column(comment = "详细地址(街道)")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String detailAddress;
}
